//
//  LHQMoreDetailCollectionViewCell.m
//  Music
//
//  Created by dllo on 16/6/7.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LHQMoreDetailCollectionViewCell.h"

@implementation LHQMoreDetailCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.picUrl = [[UIImageView  alloc] init];
        [self.contentView  addSubview:_picUrl];
        
        self.name = [[UILabel  alloc] init];
         self.name.font =  [UIFont  fontWithName:@"Helvetica-Oblique" size:14];
        [self.contentView  addSubview:_name];
        
        self.singerName = [[UILabel  alloc] init];
         self.singerName.font =  [UIFont  fontWithName:@"Helvetica-Oblique" size:12];
        [self.contentView  addSubview:_singerName];
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.picUrl.frame = CGRectMake(0, 0, (Screenwidth-15)/2-10, (Screenwidth-15)/2-10);
    self.name.frame = CGRectMake(self.picUrl.frame.origin.x, self.picUrl.frame.origin.y+self.picUrl.frame.size.height, self.picUrl.frame.size.width, 30);
    self.singerName.frame = CGRectMake(self.name.frame.origin.x, self.name.frame.origin.y+self.name.frame.size.height, self.name.frame.size.width, 10);
    
}
-(void)setModel:(LHQMoreDetailModel *)model
{
    if (_model != model) {
        _model = model;
        [self.picUrl  sd_setImageWithURL:[NSURL  URLWithString:model.picUrl] placeholderImage:[UIImage  imageNamed:@"1.jpg"]];
        self.name.text = model.name;
        self.singerName.text = model.singerName;
    }
    
    
    
    
}
@end
